package com.sip.stream.utils.zfy.encoder;

import android.util.Log;

import com.sip.stream.utils.GBUtils;

public class GSH264ASyncEncoder extends AbstractVideoMediaCodecEncoder {
    private static final String TAG = "GSH264ASyncEncoder";

    public GSH264ASyncEncoder(int width, int height, int bitrate, int frameRate, int frameInterval) {
        super(width, height, bitrate, frameRate, frameInterval);
    }

    @Override
    protected boolean setUpMediacodec(int width, int height, int bitrate, int frameRate, int frameInterval) {
        Log.i(TAG, "setUpMediacodec " + width + "x" + height + " bitRate = " + ((bitrate / 1024) / 1024) + "mbits/sec frameRate = " + frameRate);
        this.mediaCodec = GBUtils.createMediaCodec(width, height, bitrate, frameRate, frameInterval, "video/avc", TAG);
        return this.mediaCodec != null;
    }

    @Override
    public boolean isStop() {
        return this.listeners.isEmpty();
    }
}
